package org.emergency.framework.serviceImpl.common;

import javax.annotation.Resource;

import org.emergency.framework.dao.oa.ITbDepartmentDAO;
import org.emergency.framework.model.contactDeptTree.EmergencyTree;
import org.emergency.framework.service.common.ITreeDeptService;
import org.springframework.stereotype.Repository;


@Repository("treeDeptServiceImpl")
public class TreeDeptServiceImpl implements ITreeDeptService{
	
	@Resource(name = "tbDepartmentDAO")
	private ITbDepartmentDAO tbDepartmentDAO;

	
	
	/**
	 * 把树从新从内存中加载
	 */
	public void updateTree() {
		 EmergencyTree.updateEmergencyTree(tbDepartmentDAO);
	}
	
	/**
	 * 得到emegencyTree
	 * @return
	 */
	public EmergencyTree queryEmergencyTree(){
		EmergencyTree tree = EmergencyTree.getInstance(tbDepartmentDAO);
		return tree;
	}

	/**
	 * reload
	 */
	public void reloadTree() {
		// TODO Auto-generated method stub
		EmergencyTree.reloadTree(tbDepartmentDAO);
	}
}
